﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ContentmanagementBase.Infrastructure.Migrations
{
    public partial class 科室父级Id的改变 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_DepartmentManagements_HospitalManagements_ParentId",
                table: "DepartmentManagements");

            migrationBuilder.AddForeignKey(
                name: "FK_DepartmentManagements_DepartmentManagements_ParentId",
                table: "DepartmentManagements",
                column: "ParentId",
                principalTable: "DepartmentManagements",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_DepartmentManagements_DepartmentManagements_ParentId",
                table: "DepartmentManagements");

            migrationBuilder.AddForeignKey(
                name: "FK_DepartmentManagements_HospitalManagements_ParentId",
                table: "DepartmentManagements",
                column: "ParentId",
                principalTable: "HospitalManagements",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
    }
}
